/**
 * Copyright (c) 2009 Teoti Graphix, LLC See:
 *     http://tkarchitecture.teotigraphix.org
 * 
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 * 
 * @author Michael Schmalle mschmalle@teotigraphix.com
 */
package org.teotigraphix.dx.interfaces
{

import mx.core.IInvalidating;
import mx.core.IUIComponent;
import mx.styles.IStyleClient;

/**
 * The framework's core interface that marks a <code>SkinnableComponent</code>
 * as tkarchitect aware.
 * 
 * <p>The Component class in the [C]MSB pattern is the <code>DisplayObject</code> 
 * hosting the Component's public API, data model, user interface and behavioral
 * abstracted layers.</p>
 * 
 * <p>Any Component implementing this interface can then use the 
 * <code>ToolKitManager</code>'s validation methods and become framework aware
 * from activation, initialization, startup and shutdown.</p>
 * 
 * <p>The two classes that implement the <code>ToolKitManager</code>'s complete 
 * validation API are <code>DXComponent</code> and 
 * <code>DXContainer</code>.</p>
 * 
 * @copyright Teoti Graphix, LLC
 * @author Michael Schmalle
 * @date 12-04-08, 06-25-09
 */
public interface IToolKitComponent
	   extends IUIComponent, IInvalidating, IStyleClient
{
	//--------------------------------------------------------------------------
	//
	//  Properties
	//
	//--------------------------------------------------------------------------
	
	//----------------------------------
	//  toolKitInitialized
	//----------------------------------
	
	/**
	 * Determines whether the Component has a parent and has run through the
	 * <code>ToolKitManager</code>'s intialization process.
	 * 
	 * <p>The property will be true after <code>initialize()</code> runs
	 * on the component.</p>
	 * 
	 * <p>Once this property is set true, all layers are guarenteed to
	 * be initialized and active.</p>
	 */
	function get toolKitInitialized():Boolean;
	
	/**
	 * @private
	 */
	function set toolKitInitialized(value:Boolean):void;
	
	//--------------------------------------------------------------------------
	//
	//  Methods
	//
	//--------------------------------------------------------------------------
	
	/**
	 * Initializes the toolkit Component from the 
	 * <code>ToolKitManager.validateParentChanged()</code>.
	 * 
	 * <p>This happens when the <code>addChild()</code> method has been called on
	 * the component and before the <code>createChildren()</code> method is run.</p>
	 * 
	 * <p>In this phase of the toolkit initialization, core behavior assignment,
	 * factories can be set, models and behaviors created but not registered.</p>
	 * 
	 * <p>In case of model composition, this is where you wolud create the model
	 * instance so mxml properties can be set.</p>
	 */
	function initializeToolKit():void;
	
	/**
	 * Starts the toolkit and allows for <code>behaviorLayer</code> and 
	 * <code>modelLayer</code> registrations.
	 * 
	 * <p>Registering models and behaviors at this time guarentees property 
	 * notifications to the model and behavior helpers.</p>
	 * 
	 * <p>This method is called from the 
	 * <code>ToolKitManager.initializationComplete()</code> method.</p>
	 */
	function startToolKit():void;
	
	/**
	 * Restarts the toolkit and allows for <code>behaviorLayer</code> and 
	 * <code>modelLayer</code> registrations.
	 * 
	 * <p>Registering models and behaviors at this time guarentees property 
	 * notifications to the model and behavior helpers.</p>
	 * 
	 * <p>This method is called from the 
	 * <code>ToolKitManager.validateParentChanged()</code> method if
	 * <code>toolKitInitialized</code> is true.</p>
	 */
//	function restartToolKit():void;	
	
	/**
	 * Stops the toolkit and signifies the removal from parent.
	 * 
	 * <p>This method is called from the 
	 * <code>ToolKitManager.validateParentChanged()</code> method.</p>
	 */
	function stopToolKit():void;
}
}